home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / visual / linearray.c < prev    next >
C/C++ Source or Header  |  2001-05-25  |  780b  |  40 lines

  1.  
  2. #include "tek/visual.h"
  3. #include "tek/debug.h"
  4. #include "tek/kn/visual.h"
  5.  
  6. /* 
  7. **    TEKlib
  8. **    (C) 2001 TEK neoscientists
  9. **    all rights reserved.
  10. **
  11. **    TVOID TVLineArray(TAPTR visual, TINT *array, TINT num, TVPEN pen)
  12. **
  13. **    draw line array
  14. */
  15.  
  16. TVOID TVLineArray(TAPTR visual, TINT *array, TINT num, TVPEN pen)
  17. {
  18.     TVISUAL *v = (TVISUAL *) visual;
  19.     TDRAWMSG *msg;
  20.  
  21.     for (;;)
  22.     {
  23.         if ((msg = TGetMsg(v->asyncport)))
  24.         {
  25.             msg->jobcode = TVJOB_LINEARRAY;
  26.             msg->op.array.array = array;
  27.             msg->op.array.num = num;
  28.             msg->op.array.pen = pen;
  29.  
  30.             TSendMsg(v->parenttask, TTaskPort(v->task), msg);            
  31.  
  32.             kn_lock(&v->asyncport->lock);
  33.             TAddTail(&v->asyncport->msglist, (TNODE *) (((TMSG *) msg) - 1));
  34.             kn_unlock(&v->asyncport->lock);
  35.             return;
  36.         }
  37.         TWaitPort(v->asyncport);
  38.     }
  39. }
  40.